<template>
	<view v-if="info">
		<view class="p-30">
			<view class="fr-b-c">
				<view class="fl-s-s">
					<text class="c-33 fs-48">{{phoneStar(info.username)}}</text>
					<text class="c-aa fs-28 m-t-5">当前账号将注销</text>
				</view>
				<image style="width: 90rpx; height: 90rpx;" src="/static/images/tab4/zx.png" mode=""></image>
			</view>
		</view>
		<view class="rowbar"></view>
		
		<view class="w-1 fl-s-s p-30">
			<view class="w-1 fr-b-c">
				<text class="c-33 fs-28">需满足以下条件才可成功注销账号：</text>
				<view class="fr-s-c" @click="getinfo">
					<image style="width: 34rpx; height: 34rpx;"  src="/static/images/tab4/re.png" mode=""></image>
					<text class="fs-28 m-l-10" style="color: #3E8BFF;">重新检测</text>
				</view>
			</view>
			<view class="w-1 fr-b-c m-t-35">
				<text class="c-33 fs-28">无资金问题待结算</text>
				<text style="color: #319A42;" v-if="info.yi_status==1" class="fs-28 bold">已满足</text>
				<text v-else class="fs-28 c-price bold">未满足</text>
			</view>
			<text class="c-aa fs-28 m-t-15">账户全部资金提现后即可发起账号注销</text>
			<view class="w-1 bb-solid m-t-25"></view>
			<view class="w-1 fr-b-c m-t-35">
				<text class="c-33 fs-28">所有订单已完结</text>
				<text style="color: #319A42;" v-if="info.er_status==1" class="fs-28 bold">已满足</text>
				<text v-else class="fs-28 c-price bold">未满足</text>
			</view>
			<text class="c-aa fs-28 m-t-15">账号无需继续服务或待收款的订单</text>
			<view class="w-1 bb-solid m-t-25"></view>
		</view>
		<view class="iphonex">
			<view class="w-1 p-30">
				<view class="big-btn" @click="sub">确认无误，发起注销</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {phoneStar } from '@/utils/util.js'
	const reason = ref("")
	const content = ref("")
	onLoad(o=>{
		reason.value = o.reason;
		content.value = o.content;
	})
	getinfo()
	const info = ref('')
	function getinfo(){
		uni.$post({
			url:'/api/Other/Cancel_detection_status'
		}).then(res=>{
			info.value = res.data;
		})
	}
	
	function sub(){
		if(info.value.yi_status==0 || info.value.er_status==0) return uni.$u.toast('暂不满足注销条件~')
		uni.$post({
			url:'/api/User/Cancel_user',
			data:{
				type:reason.value,
				content:content.value
			}
		}).then(res=>{
			uni.clearStorageSync()
			uni.reLaunch({
				url: '/pages/Login/Login'
			})
		})
	}
</script>

<style>
.rowbar{
	width: 750rpx;
	height: 20rpx;
	background: #F1F5F6;
	border-radius: 0rpx 0rpx 0rpx 0rpx;
}
</style>
